<?php get_instance()->view('common/header');?>
<body class="bag3">
<form action="" id="save-form" method="post">
<div class="weui-cells mb10">

    <div class="weui-cell">
        <div class="weui-cell__hd"><img src="<?php echo $this->staticUrl?>img/png/s4.png" class="heightimg mr5" alt=""></div>
        <div class="weui-cell__bd">
            <input name="oldpassword" class="weui-input f08" type="number" pattern="[0-9]*" placeholder="请输入旧支付密码">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><img src="<?php echo $this->staticUrl?>img/png/s5.png" class="heightimg mr5" alt=""></div>
        <div class="weui-cell__bd">
            <input name="password" class="weui-input f08" type="password" pattern="[0-9]*" placeholder="设置支付密码">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><img src="<?php echo $this->staticUrl?>img/png/s5.png" class="heightimg mr5" alt=""></div>
        <div class="weui-cell__bd">
            <input name="repassword" class="weui-input f08" type="password" pattern="[0-9]*" placeholder="确认支付密码">
        </div>
    </div>
</div>
<!--<div class="hengright mb15 mr5">
    <a href="<?php echo getUrl("user/setPayPasswd")?>" class="hongzi f08">忘记支付密码？</a>
</div>-->
<button class="kbtn">保 存</button>
</form>
</body>
<script src="<?php echo $this->staticUrl?>js/base.js"></script>
<script type="text/javascript">
    $(function () {
        $.e_validate.init('#save-form',{saveMessage:'保存中...'});
    })
</script>
<script>

    $(function(){

        $('.sendyzm').click(function(){
            var phone = '<?php echo $this->userMobile;?>';
            if(phone == ""){
                show_message({status:0, message:'请输入手机号码'});
                return false;
            }
            var reg = /^0?1[3|4|5|7|8|9][0-9]\d{8}$/;
            if (!(reg.test(phone))) {
                show_message({status:0, message:'请输入正确的手机号码'});
                return false;
            }

            $.ajax({
                url: '<?php echo getUrl("user/getPayPasswdVerifyCode")?>',
                type:"POST",
                data:{
                    mobile:phone
                },

                success:function(arr){
                    if(arr.status == "1"){
                        tt = setInterval(time_show,1000);
                    }
                    show_message({status:arr.status, message:arr.message});

                    return false;
                },
                dataType:'json'
            });
        })

    });

    var time=60;
    function time_show(){
        if(time>1){
            time=time-1;
            $(".sendyzm").text(time+'s');
            $('[name="mobile"]').attr("readonly",true);
        }else{
            $(".sendyzm").text('重新获取');
            $('[name="mobile"]').attr("readonly",false);
            $('.sendyzm').attr('disabled',false);
            clearInterval(tt);
            time=60;
        }

    }
</script>
</html>